import React, { Component } from 'react';
import { Feedback, Loading } from '@icedesign/base';

export default class LoadingTip extends Component {
  static displayName = 'Loading';

  constructor(props) {
    super(props);
    this.state = { };
  }

  render() {
    if(this.props.loading){ 
      return (
        <div style={styles.full}>
          <div style={styles.loading}>
            <Loading shape="fusion-reactor" color="#fff"/>
          </div>
        </div>
      );
    }else{
      return null
    }
  }
}

const styles = {
  full : {
    position: 'absolute',
    left: 0,
    right: 0,
    top: 0,
    bottom: 0,
    backgroundColor: 'rgba(0,0,0,0.3)',
    zIndex: '9999',
  },
  loading : {
    position: 'fixed',
    top: '50%',
    left: '50%',
  }
}